/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bookshop.DTO;

import com.bookshop.entity.Book;
import java.io.Serializable;

/**
 *
 * @author Samir
 */
public class CartItem implements Serializable {

    private Book item;
    private int quantity;

    public CartItem(Book item, int quantity) {
        this.item = item;
        this.quantity = quantity;
    }

    public Book getItem() {
        return item;
    }

    public void setItem(Book item) {
        this.item = item;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public double getSubTotal() {
        double subTotal = Math.floor((item.getPrice() * quantity) * 100)/100;
        return subTotal;
    }
}
